package com.aizuda.boot.modules.business.counterparty.entity.vo;


import com.aizuda.boot.modules.business.counterparty.entity.dto.BankInfoDTO;
import com.aizuda.boot.modules.business.negotiation.entity.dto.ContractVersionHistoryRespDTO;
import com.aizuda.boot.modules.file.domain.entity.FileInfo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

@Data
@Schema(description = "交易方分页响应")
public class CounterpartyPageRespDTO {
    
    @Schema(description = "总记录数")
    private Long total;
    
    @Schema(description = "当前页码")
    private Integer pageNum;
    
    @Schema(description = "每页条数")
    private Integer pageSize;
    
    @Schema(description = "总页数")
    private Integer totalPages;
    
    @Schema(description = "交易方列表")
    private List<CounterpartyItemDTO> items;
    
    @Data
    @Schema(description = "交易方列表项")
    public static class CounterpartyItemDTO {
        
        @Schema(description = "主键ID")
        private Integer id;
        
        @Schema(description = "交易方编码")
        private String counterpartyCode;
        
        @Schema(description = "交易方名称")
        private String counterpartyName;
        
        @Schema(description = "注册国家代码")
        private String registerCountry;
        
        @Schema(description = "注册国家名称")
        private String registerCountryName;
        
        @Schema(description = "交易方性质")
        private Integer counterpartyNature;
        
        @Schema(description = "交易方性质描述")
        private String counterpartyNatureDesc;
        
        @Schema(description = "交易方类型")
        private List<Integer> counterpartyType;
        
        @Schema(description = "交易方类型描述")
        private List<String> counterpartyTypeDesc;
        
        @Schema(description = "是否关联方(0:否,1:是)")
        private Boolean isRelatedParty;
        
        @Schema(description = "关联方状态文本")
        private String relatedPartyText;
        
        @Schema(description = "证件类型")
        private Integer certificateType;
        
        @Schema(description = "证件类型描述")
        private String certificateTypeDesc;
        
        @Schema(description = "证件ID")
        private String certificateId;
        
        @Schema(description = "是否启用(0:停用,1:启用)")
        private Boolean isEnabled;
        
        @Schema(description = "启用状态文本")
        private String statusText;

        @Schema(description = "是否风险(0:否,1:是)")
        private Boolean isRisk;

        @Schema(description = "风险类型")
        private Integer riskType;

        @Schema(description = "风险类型描述")
        private String riskTypeDesc;

        @Schema(description = "创建应用ID")
        private String createAppid;

        @Schema(description = "创建来源")
        private String createSource;

        @Schema(description = "更新应用ID")
        private String updateAppid;

        @Schema(description = "更新来源")
        private String updateSource;
        
        @Schema(description = "银行账户数量")
        private Integer bankAccountCount;
        
        @Schema(description = "银行账户列表")
        private List<BankInfoDTO> bankInfoList;

        @Schema(description = "创建人")
        private String createBy;

        @Schema(description = "创建时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime createdAt;

        @Schema(description = "修改人")
        private String updateBy;

        @Schema(description = "更新时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime updatedAt;

        @Schema(description = "附件列表")
        private List<FileInfoDTO> attachments;

        @Schema(description = "系统租户")
        private List<String> sysTenantKey;

        @Schema(description = "租户名称")
        private String tenantName;
    }

    @Data
    public static class FileInfoDTO {

        @Schema(description = "文件ID")
        private Long fileId;

        @Schema(description = "文件名")
        private String fileName;

        @Schema(description = "文件类型")
        private String fileType;

        @Schema(description = "文件Key")
        private String fileKey;

        @Schema(description = "文件大小(单位byte)")
        private Long fileSize;
    }
} 